package com.ajie.lib_base.ft_file;

import java.io.File;

/**
 * Created by zhangyingjie on 2020/9/17
 *
 * @function
 */
public class FileFilter {

    public static File[] fileter(File dir,String filter){
        if (dir == null || !dir.exists() || dir.isFile())  {
            return null;
        }
       return dir.listFiles(new java.io.FileFilter() {
            @Override
            public boolean accept(File file) {
                return file!=null && file.exists() && file.getName().contains(filter);
            }
        });

    }
}
